from flask import render_template

from app import login_required_with_check_scope
from app.admin import admin
from app.model.user import User


@admin.route('/user/list', methods=['GET'])
@login_required_with_check_scope
def user_list_ep():
    """
        管理员查看用户列表
    """
    users = User.query.filter(User.admin == 0).order_by(User.create_time.asc()).all()
    return render_template('admin/user/list.html', users=users)
